<template>
  <div>
    <el-form :model="form" label-width="120px">
      <el-form-item label="诊断相关检查:">
        <el-checkbox-group v-model="form.name" @change="handleChecked">
          <el-checkbox
            v-for="item in name"
            :key="item.index"
            :label="item.index"
            name="name"
          >
            {{ item.title }}
          </el-checkbox>
          <!-- <el-checkbox key="1" label="新斯的明试验" name="name" />
          <el-checkbox key="2" label="冰敷试验" name="name" />
          <el-checkbox key="3" label="疲劳试验" name="name" />
          <el-checkbox key="4" label="重复频率电刺激" name="name" />
          <el-checkbox key="5" label="单纤维肌电图" name="name" />
          <el-checkbox key="6" label="胸腺影像学检查" name="name" /> -->
          <!-- <el-checkbox key="7" label="抗体检测" name="name" /> -->
        </el-checkbox-group>
      </el-form-item>
      <div v-show="nameValue.indexOf('1') !== -1">
        <el-divider />
        <h4>新斯的明试验</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check1" placeholder="请选择">
            <el-option label="阳性" value="1" />
            <el-option label="阴性" value="2" />
            <el-option label="可疑" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查图片">
          <upload ref="check1" />
        </el-form-item>
      </div>
      <div v-show="nameValue.indexOf('2') !== -1">
        <el-divider />
        <h4>冰敷试验</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check2" placeholder="请选择">
            <el-option label="阳性" value="1" />
            <el-option label="阴性" value="2" />
            <el-option label="可疑" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查图片">
          <upload ref="check2" />
        </el-form-item>
      </div>
      <div v-show="nameValue.indexOf('3') !== -1">
        <el-divider />
        <h4>疲劳试验</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check3" placeholder="请选择">
            <el-option label="阳性" value="1" />
            <el-option label="阴性" value="2" />
            <el-option label="可疑" value="3" />
          </el-select>
        </el-form-item>
      </div>
      <div v-show="nameValue.indexOf('4') !== -1">
        <el-divider />
        <h4>重复频率电刺激</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check4" placeholder="请选择">
            <el-option label="阳性" value="1" />
            <el-option label="阴性" value="2" />
            <el-option label="可疑" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查图片">
          <upload ref="check4" />
        </el-form-item>
      </div>
      <div v-show="nameValue.indexOf('5') !== -1">
        <el-divider />
        <h4>单纤维肌电图</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check5" placeholder="请选择">
            <el-option label="阳性" value="1" />
            <el-option label="阴性" value="2" />
            <el-option label="可疑" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查图片">
          <upload ref="check5" />
        </el-form-item>
      </div>
      <div v-show="nameValue.indexOf('6') !== -1">
        <el-divider />
        <h4>胸腺影像学检查</h4>
        <el-form-item label="检查单位">
          <el-select v-model="form.checkOrganization" placeholder="请选择">
            <el-option label="本院" value="1" />
            <el-option label="外院" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查手段">
          <el-select v-model="form.checkOprate" placeholder="请选择">
            <el-option label="CT平扫" value="1" />
            <el-option label="增强CT" value="2" />
            <el-option label="MRI" value="3" />
            <el-option label="其他" value="4" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果">
          <el-select v-model="form.check6" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="胸腺增生" value="2" />
            <el-option label="胸腺瘤" value="3" />
            <el-option label="其他" value="4" />
          </el-select>
        </el-form-item>
        <el-form-item label="检查图片">
          <upload ref="check6" />
        </el-form-item>
      </div>
      <el-form-item label="治疗相关检查:">
        <el-checkbox-group v-model="form.name2" @change="handleChecked2">
          <el-checkbox
            v-for="item in name2"
            :key="item.index"
            :label="item.index"
            name="name2"
          >
            {{ item.title }}
          </el-checkbox>
          <!-- <el-checkbox key="8" label="基因检测" name="name2" />
          <el-checkbox key="9" label="血常规" name="name2" />
          <el-checkbox key="10" label="血生化" name="name2" />
          <el-checkbox key="11" label="血压" name="name2" />
          <el-checkbox key="12" label="血糖" name="name2" />
          <el-checkbox key="13" label="心电图" name="name2" />
          <el-checkbox key="14" label="血气分析" name="name2" />
          <el-checkbox key="15" label="骨密度" name="name2" />
          <el-checkbox key="16" label="肺功能" name="name2" />
          <el-checkbox key="17" label="免疫相关检查" name="name2" /> -->
        </el-checkbox-group>
      </el-form-item>
      <div v-show="name2Value.indexOf('8') !== -1">
        <el-divider />
        <h4>药物基因组检测</h4>
        <el-form-item label="基因检测位点">
          <el-input v-model="form.check8a" style="width:200px" />
        </el-form-item>
        <el-form-item label="基因检测抑制位置">
          <el-input v-model="form.check8b" style="width:200px" />
        </el-form-item>
        <el-form-item label="基因型">
          <el-input v-model="form.check8c" style="width:200px" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('9') !== -1">
        <el-divider />
        <h4>血常规</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check9" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check9" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('10') !== -1">
        <el-divider />
        <h4>血生化</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check10" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check10" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('11') !== -1">
        <el-divider />
        <h4>血压</h4>
        <el-form-item label="收缩压">
          <el-input v-model="form.check11d" style="width:200px" />
        </el-form-item>
        <el-form-item label="舒张压">
          <el-input v-model="form.check11e" style="width:200px" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('12') !== -1">
        <el-divider />
        <h4>血糖</h4>
        <el-form-item label="空腹血糖">
          <el-input v-model="form.check12f" style="width:200px" />
        </el-form-item>
        <el-form-item label="餐后1小时血糖">
          <el-input v-model="form.check12g" style="width:200px" />
        </el-form-item>
        <el-form-item label="糖化血红蛋白">
          <el-select v-model="form.check12" placeholder="请选择">
            <el-option label="已做" value="1" />
            <el-option label="未做" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check12" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('17') !== -1">
        <el-divider />
        <h4>免疫相关检查</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check17" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check17" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('13') !== -1">
        <el-divider />
        <h4>心电图</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check13" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check13" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('16') !== -1">
        <el-divider />
        <h4>肺功能</h4>
        <el-form-item label="FVC">
          <el-input v-model="form.fvc" style="width:200px" />
        </el-form-item>
        <el-form-item label="FEV1">
          <el-input v-model="form.fev1" style="width:200px" />
        </el-form-item>
        <el-form-item label="FEV1/FVC(%)">
          <el-input v-model="fev1fvc" style="width:200px" readonly />
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check16" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('14') !== -1">
        <el-divider />
        <h4>血气分析</h4>
        <el-form-item label="低氧">
          <el-select v-model="form.check14" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="PaO2">
          <el-input v-model="form.x" style="width:200px" />
        </el-form-item>
        <el-form-item label="PaOC2">
          <el-input v-model="form.y" style="width:200px" />
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check14" />
        </el-form-item>
      </div>
      <div v-show="name2Value.indexOf('15') !== -1">
        <el-divider />
        <h4>骨密度</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check15" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="腰椎T值">
          <el-input v-model="form.a1" style="width:200px" />
        </el-form-item>
        <el-form-item label="腰椎Z值">
          <el-input v-model="form.a2" style="width:200px" />
        </el-form-item>
        <el-form-item label="左侧肱骨头T值">
          <el-input v-model="form.a3" style="width:200px" />
        </el-form-item>
        <el-form-item label="左侧肱骨头Z值">
          <el-input v-model="form.a4" style="width:200px" />
        </el-form-item>
        <el-form-item label="右侧肱骨头T值">
          <el-input v-model="form.a5" style="width:200px" />
        </el-form-item>
        <el-form-item label="右侧肱骨头Z值">
          <el-input v-model="form.a6" style="width:200px" />
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check15" />
        </el-form-item>
      </div>
      <el-form-item label="其他检查:">
        <el-checkbox-group v-model="form.name3" @change="handleChecked3">
          <el-checkbox
            v-for="item in name3"
            :key="item.index"
            :label="item.index"
            name="name3"
          >
            {{ item.title }}
          </el-checkbox>
          <!-- <el-checkbox key="18" label="甲功全项" name="name3" />
          <el-checkbox key="19" label="肿瘤标志物" name="name3" />
          <el-checkbox key="20" label="其他" name="name3" /> -->
        </el-checkbox-group>
      </el-form-item>
      <div v-show="name3Value.indexOf('18') !== -1">
        <el-divider />
        <h4>甲功全项</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check18" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check18" />
        </el-form-item>
      </div>
      <div v-show="name3Value.indexOf('19') !== -1">
        <el-divider />
        <h4>肿瘤标志物</h4>
        <el-form-item label="结果">
          <el-select v-model="form.check19" placeholder="请选择">
            <el-option label="正常" value="1" />
            <el-option label="异常" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="结果报告">
          <upload ref="check19" />
        </el-form-item>
      </div>
      <div v-show="name3Value.indexOf('20') !== -1">
        <el-divider />
        <h4>其他</h4>
        <el-form-item label="结果报告">
          <upload ref="check20" />
        </el-form-item>
      </div>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import Upload from '../upload'
import { addCheck } from '@/api/testDashboard'
import { initData } from '@/api/data'
export default {
  components: {
    Upload
  },
  data() {
    return {
      form: {
        id: '',
        pId: this._routerRoot._route.query.id,
        name: [],
        name2: [],
        name3: [],
        nameDto: [],
        name2Dto: [],
        name3Dto: [],
        check1: 0,
        check2: 0,
        check3: 0,
        check4: 0,
        check5: 0,
        check6: 0,
        check7: 0,
        check8: 0,
        check9: 0,
        check10: 0,
        check11: 0,
        check12: 0,
        check13: 0,
        check14: 0,
        check15: 0,
        check16: 0,
        check17: 0,
        check18: 0,
        check19: 0,
        check20: 0,
        checkOrganization: 0,
        checkOprate: 0,
        check8a: 0,
        check8b: 0,
        check8c: 0,
        check11d: 0,
        check11e: 0,
        check12f: 0,
        check12g: 0,
        x: 0,
        y: 0,
        a1: 0,
        a2: 0,
        a3: 0,
        a4: 0,
        a5: 0,
        a6: 0,
        fev1: 0,
        fvc: 0
      },
      query: {
        pid: this._routerRoot._route.query.id
      },
      nameValue: [],
      name2Value: [],
      name3Value: [],
      name: [
        {
          index: '1',
          name: 'check1',
          title: '新斯的明试验'
        },
        {
          index: '2',
          name: 'check2',
          title: '冰敷试验'
        },
        {
          index: '3',
          name: 'check3',
          title: '疲劳试验'
        },
        {
          index: '4',
          name: 'check4',
          title: '重复频率电刺激'
        },
        {
          index: '5',
          name: 'check5',
          title: '单纤维肌电图'
        },
        {
          index: '6',
          name: 'check6',
          title: '胸腺影像学检查'
        }
      ],
      name2: [
        {
          index: '8',
          name: 'check8',
          title: '基因检测'
        },
        {
          index: '9',
          name: 'check9',
          title: '血常规'
        },
        {
          index: '10',
          name: 'check10',
          title: '血生化'
        },
        {
          index: '11',
          name: 'check11',
          title: '血压'
        },
        {
          index: '12',
          name: 'check12',
          title: '血糖'
        },
        {
          index: '13',
          name: 'check13',
          title: '心电图'
        },
        {
          index: '14',
          name: 'check14',
          title: '血气分析'
        },
        {
          index: '15',
          name: 'check15',
          title: '骨密度'
        },
        {
          index: '16',
          name: 'check16',
          title: '肺功能'
        },
        {
          index: '17',
          name: 'check17',
          title: '免疫相关检查'
        }
      ],
      name3: [
        {
          index: '18',
          name: 'check18',
          title: '甲功全项'
        },
        {
          index: '19',
          name: 'check19',
          title: '肿瘤标志物'
        },
        {
          index: '20',
          name: 'check20',
          title: '其他'
        }

      ]

    }
  },
  computed: {
    fev1fvc() {
      console.log(this.form.fev1)
      return this.form.fev1 / this.form.fvc * 100
    }
  },
  created() {
    initData('/api/inspectionDiagnosis/findByPid', this.query).then(res => {
      this.form.id = res.id
      console.log('---------')
      console.log(res)
      if (res.name) {
        this.form.name = res.name
        this.nameValue = res.name
      }
      if (res.name2) {
        this.form.name2 = res.name2
        this.name2Value = res.name2
      }
      if (res.name3) {
        this.form.name3 = res.name3
        this.name3Value = res.name3
      }
      console.log(this.$refs.check1)
      // for (const index in res.nameDto) {
      //   console.log(index);
      //   switch(parseInt(res.nameDto[index].type)){
      //     case 1:
      //        var p1 = res.nameDto[index].picture.split(',')
      //        var r1 = res.nameDto[index].result.split(',')
      //        var images1 = []
      //        p1.forEach(function(item) {
      //             var obj = {
      //               url: item
      //             }
      //             images1.push(obj)
      //           })
      //     this.form.check1 = r1[0]
      //     this.$refs.check1.fileList = images1
      //     this.form.check1id = res.nameDto[index].id
      //       break
      //   }
      // }
      res.nameDto.forEach(function(dto) {
        if (dto.picture) {
          var images = []
          var array = dto.picture.split(',')
          array.forEach(function(item) {
            var obj = {
              url: item
            }
            images.push(obj)
          })
        }
        var list = []
        if (dto.result) {
          list = dto.result.split(',')
        }
        if (dto.type === 1) {
          this.form.check1 = list[0]
          this.$refs.check1.fileList = images
          this.$refs.check1.images = dto.picture
          this.form.check1id = dto.id
        }
        if (dto.type === 2) {
          this.form.check2 = list[0]
          this.$refs.check2.fileList = images
          this.$refs.check2.images = dto.picture
          this.form.check2id = dto.id
        }
        if (dto.type === 3) {
          this.form.check3 = list[0]
          this.form.check3id = dto.id
        }
        if (dto.type === 4) {
          this.form.check4 = list[0]
          this.$refs.check4.fileList = images
          this.$refs.check4.images = dto.picture
          this.form.check4id = dto.id
        }
        if (dto.type === 5) {
          this.form.check5 = list[0]
          this.$refs.check5.fileList = images
          this.$refs.check5.images = dto.picture
          this.form.check5id = dto.id
        }
        if (dto.type === 6) {
          this.form.checkOrganization = list[0]
          this.form.checkOprate = list[1]
          this.form.check6 = list[2]
          this.$refs.check6.fileList = images
          this.$refs.check6.images = dto.picture
          this.form.check6id = dto.id
        }
      }, this)
      res.name2Dto.forEach(function(dto) {
        if (dto.picture) {
          var array = dto.picture.split(',')
          var images = []
          array.forEach(function(item) {
            var obj = {
              url: item
            }
            images.push(obj)
          })
        }
        var list = []
        if (dto.result) {
          list = dto.result.split(',')
        }
        if (dto.type === 8) {
          this.form.check8a = list[0]
          this.form.check8b = list[1]
          this.form.check8c = list[2]
          this.form.check8id = dto.id
        }
        if (dto.type === 9) {
          this.form.check9 = list[0]
          this.$refs.check9.fileList = images
          this.$refs.check9.images = dto.picture
          this.form.check9id = dto.id
        }
        if (dto.type === 10) {
          this.form.check10 = list[0]
          this.$refs.check10.fileList = images
          this.$refs.check10.images = dto.picture
          this.form.check10id = dto.id
        }
        if (dto.type === 11) {
          this.form.check11d = list[0]
          this.form.check11e = list[1]
          this.form.check11id = dto.id
        }
        if (dto.type === 12) {
          this.form.check12f = list[0]
          this.form.check12g = list[1]
          this.form.check12 = list[2]
          this.$refs.check12.fileList = images
          this.$refs.check12.images = dto.picture
          this.form.check12id = dto.id
        }
        if (dto.type === 13) {
          this.form.check13 = list[0]
          this.$refs.check13.fileList = images
          this.$refs.check13.images = dto.picture
          this.form.check13id = dto.id
        }
        if (dto.type === 14) {
          this.form.check14 = list[0]
          this.form.x = list[1]
          this.form.y = list[2]
          this.$refs.check14.fileList = images
          this.$refs.check14.images = dto.picture
          this.form.check14id = dto.id
        }
        if (dto.type === 15) {
          this.form.check15 = list[0]
          this.form.a1 = list[1]
          this.form.a2 = list[2]
          this.form.a3 = list[3]
          this.form.a4 = list[4]
          this.form.a5 = list[5]
          this.form.a6 = list[6]
          this.$refs.check15.fileList = images
          this.$refs.check15.images = dto.picture
          this.form.check15id = dto.id
        }
        if (dto.type === 16) {
          console.log(list)
          console.log(parseInt(list[0]))
          this.form.fvc = parseInt(list[0])
          this.form.fev1 = parseInt(list[1])
          this.$refs.check16.fileList = images
          this.$refs.check16.images = dto.picture
          this.form.check16id = dto.id
        }
        if (dto.type === 17) {
          this.form.check17 = list[0]
          this.$refs.check17.fileList = images
          this.$refs.check17.images = dto.picture
          this.form.check17id = dto.id
        }
      }, this)
      res.name3Dto.forEach(function(dto) {
        if (dto.picture) {
          var array = dto.picture.split(',')
          var images = []
          array.forEach(function(item) {
            var obj = {
              url: item
            }
            images.push(obj)
          })
        }
        var list = []
        if (dto.result) {
          list = dto.result.split(',')
        }
        if (dto.type === 18) {
          this.form.check18 = list[0]
          this.$refs.check18.fileList = images
          this.$refs.check18.images = dto.picture
          this.form.check18id = dto.id
        }
        if (dto.type === 19) {
          this.form.check19 = list[0]
          this.$refs.check19.fileList = images
          this.$refs.check19.images = dto.picture
          this.form.check19id = dto.id
        }
        if (dto.type === 20) {
          this.$refs.check20.fileList = images
          this.$refs.check20.images = dto.picture
          this.form.check20id = dto.id
        }
      }, this)
    })
  },
  // mounted() {
  //   console.log('liangwei0000')
  //   this.nameValue = this.form.name
  //   this.name2Value = this.form.name2
  //   this.name3Value = this.form.name3
  //   console.log(this.$refs.check1)
  //   // this.$refs.check1.fileList = [
  //   //   {
  //   //     name: 'a.png',
  //   //     url: 'https://dss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/tam-ogel/-453386020_1634404727_259_194.jpg'
  //   //   }
  //   // ]
  //   // this.$refs.check1.dialogImageUrl = '/Users/junliang/Downloads/eladmin/~/file/图片/logo-20211030111548397.png'
  // },
  methods: {
    onSubmit() {
      // this.form.name =
      var obj1 = {
        pId: this._routerRoot._route.query.id,
        type: 1,
        result: this.form.check1,
        picture: this.$refs.check1.images,
        id: this.form.check1id
      }
      var obj2 = {
        pId: this._routerRoot._route.query.id,
        type: 2,
        result: this.form.check2,
        picture: this.$refs.check2.images,
        id: this.form.check2id
      }
      var obj3 = {
        pId: this._routerRoot._route.query.id,
        type: 3,
        result: this.form.check3,
        id: this.form.check3id
        // picture:this.$refs.check3.images,
      }
      var obj4 = {
        pId: this._routerRoot._route.query.id,
        type: 4,
        result: this.form.check4,
        picture: this.$refs.check4.images,
        id: this.form.check4id
      }
      var obj5 = {
        pId: this._routerRoot._route.query.id,
        type: 5,
        result: this.form.check5,
        picture: this.$refs.check5.images,
        id: this.form.check5id
      }
      var obj6 = {
        pId: this._routerRoot._route.query.id,
        type: 6,
        result: this.form.checkOrganization + ',' + this.form.checkOprate + ',' + this.form.check6,
        picture: this.$refs.check6.images,
        id: this.form.check6id
      }
      // var obj7 = {
      //   pId:this._routerRoot._route.query.id,
      //   type: 1,
      //   result:this.form.check1,
      //   picture:this.$refs.check1.images,
      // }
      var obj8 = {
        pId: this._routerRoot._route.query.id,
        type: 8,
        result: this.form.check8a + ',' + this.form.check8b + ',' + this.form.check8c + ',',
        id: this.form.check8id
        // picture:this.$refs.check8.images,
      }
      var obj9 = {
        pId: this._routerRoot._route.query.id,
        type: 9,
        result: this.form.check9,
        picture: this.$refs.check9.images,
        id: this.form.check9id
      }
      var obj10 = {
        pId: this._routerRoot._route.query.id,
        type: 10,
        result: this.form.check10,
        picture: this.$refs.check10.images,
        id: this.form.check10id
      }
      var obj11 = {
        pId: this._routerRoot._route.query.id,
        type: 11,
        result: this.form.check11d + ',' + this.form.check11e,
        id: this.form.check11id
        // picture:this.$refs.check11.images,
      }
      var obj12 = {
        pId: this._routerRoot._route.query.id,
        type: 12,
        result: this.form.check12f + ',' + this.form.check12g + ',' + this.form.check12,
        picture: this.$refs.check12.images,
        id: this.form.check12id
      }
      var obj13 = {
        pId: this._routerRoot._route.query.id,
        type: 13,
        result: this.form.check13,
        picture: this.$refs.check13.images,
        id: this.form.check13id
      }
      var obj14 = {
        pId: this._routerRoot._route.query.id,
        type: 14,
        result: this.form.check14 + ',' + this.form.x + ',' + this.form.y,
        picture: this.$refs.check14.images,
        id: this.form.check14id
      }
      var obj15 = {
        pId: this._routerRoot._route.query.id,
        type: 15,
        result: this.form.check15 + ',' + this.form.a1 + ',' + this.form.a2 + ',' + this.form.a3 + ',' + this.form.a4 + ',' + this.form.a5 + ',' + this.form.a6,
        picture: this.$refs.check15.images,
        id: this.form.check15id
      }
      var obj16 = {
        pId: this._routerRoot._route.query.id,
        type: 16,
        result: this.form.fvc + ',' + this.form.fev1,
        picture: this.$refs.check16.images,
        id: this.form.check16id
      }
      var obj17 = {
        pId: this._routerRoot._route.query.id,
        type: 17,
        result: this.form.check17,
        picture: this.$refs.check17.images,
        id: this.form.check17id
      }
      var obj18 = {
        pId: this._routerRoot._route.query.id,
        type: 18,
        result: this.form.check18,
        picture: this.$refs.check18.images,
        id: this.form.check18id
      }
      var obj19 = {
        pId: this._routerRoot._route.query.id,
        type: 19,
        result: this.form.check19,
        picture: this.$refs.check19.images,
        id: this.form.check19id
      }
      var obj20 = {
        pId: this._routerRoot._route.query.id,
        type: 20,
        // result:this.form.check20,
        picture: this.$refs.check20.images,
        id: this.form.check20id
      }

      this.form.nameDto = []
      this.form.name2Dto = []
      this.form.name3Dto = []
      this.form.nameDto.push(obj1)
      this.form.nameDto.push(obj2)
      this.form.nameDto.push(obj3)
      this.form.nameDto.push(obj4)
      this.form.nameDto.push(obj5)
      this.form.nameDto.push(obj6)
      // this.form.nameDto.push(obj7)
      this.form.name2Dto.push(obj8)
      this.form.name2Dto.push(obj9)
      this.form.name2Dto.push(obj10)
      this.form.name2Dto.push(obj11)
      this.form.name2Dto.push(obj12)
      this.form.name2Dto.push(obj13)
      this.form.name2Dto.push(obj14)
      this.form.name2Dto.push(obj15)
      this.form.name2Dto.push(obj16)
      this.form.name2Dto.push(obj17)
      this.form.name3Dto.push(obj18)
      this.form.name3Dto.push(obj19)
      this.form.name3Dto.push(obj20)
      console.log(this.form)
      addCheck(this.form).then(res => {
        alert('保存成功！')
      })
    },
    handleChecked(v) {
      this.nameValue = v
    },
    handleChecked2(v) {
      this.name2Value = v
    },
    handleChecked3(v) {
      this.name3Value = v
    }
  }
}
</script>

<style>
.my_input {
  widows: 200px;
}
</style>
